<title>model</title>
<!--&lt;!&ndash; 配置文件 &ndash;&gt;-->
<script type="text/javascript" src="./src/lib/ueditor/ueditor.config.js"></script>
<!--&lt;!&ndash; 编辑器源码文件 &ndash;&gt;-->
<script type="text/javascript" src="./src/lib/ueditor/ueditor.all.js"></script>
<link type="text/css" rel="styleSheet" href="./src/style/model.css"/>
<div class="layui-fluid">
    <div class="layui-col-md12">
        <form class="layui-form layui-col-md11">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input name="searchName" placeholder="请输入名称" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-input-inline">
                    <a class="layui-btn" lay-submit lay-filter="find">查询</a>
                </div>
            </div>
        </form>
        <a class="layui-btn layui-col-md1" lay-submit lay-filter="showAdd">新增</a>
    </div>
    <!--弹出层-->
    <form class="layui-form" style='display:none;' id="add_edit_form">
        <div class="layui-form-item">
            <label class="layui-form-label">文本</label>
            <div class="layui-input-inline">
                <input name="name" required lay-verify="required" placeholder="请输入文本" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">不固定下拉</label>
            <div class="layui-input-inline">
                <select name="unfixedSelects" id="unfixedSelects"> </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">固定下拉</label>
            <div class="layui-input-inline">
                <select name="fixedSelects" id="fixedSelects">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图片</label>
            <div class="layui-input-block">
					<span class="layui-col-md12" style="position:relative; display:block;">
						<a class="layui-btn layui-col-md4">上传</a>
						<input id="addImgPut" type="file">
					</span>
                <img id="image">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图片1</label>
            <div class="layui-input-block">
                <a class="layui-btn layui-col-md1 addImgPut1" style="width: 140px">上传</a>
                <p style="height: 40px;"></p>
                <div id="image1"></div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">文本域</label>
            <div class="layui-input-inline">
                <textarea name="text_area" required lay-verify="required" placeholder="请输入详细说明"
                          class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择时间</label>
            <div class="layui-input-inline">
                <input name="datetime" id="datetime" required lay-verify="required" placeholder="请选择时间"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">百度富文本编辑器：</label>
            <div class="layui-input-block">
                <div id="editor"></div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">单选框</label>
            <div class="layui-input-block">
                <input type="radio" name="radio" value="1" title="1" checked/>
                <input type="radio" name="radio" value="2" title="2"/>
                <input type="radio" name="radio" value="3" title="3"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">原始复选框</label>
            <div class="layui-input-block">
                <input type="checkbox" name="like1[write]" lay-skin="primary" title="写作" checked="">
                <input type="checkbox" name="like1[read]" lay-skin="primary" title="阅读">
                <input type="checkbox" name="like1[game]" lay-skin="primary" title="游戏" disabled="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" checked lay-skin="switch" lay-text="开启|关闭">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input name="sort" required lay-verify="required" placeholder="请输入排序" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <a class="layui-btn" id="btn" lay-submit lay-filter="sub">提交</a>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
    <!--数据表格-->
    <div class="layui-col-md12">
        <table id="pageTable" lay-filter="pageTable" lay-data="{id: 'pageTable'}"></table>
    </div>
</div>
<div class="introduce_images"></div>
<!--添加/编辑签名-->
<script type="text/javascript">
    layui.use('model', layui.factory('model'));
</script>
<script type="text/html" id="operations">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
</script>
<!--图片模板-->
<script type="text/html" id="imgTpl">
    <img class="layui-upload-img" style="width:40px; height:40px"
         src={{ d.pic_url }}>
</script>
<!--状态码模板-->
<script type="text/html" id="statusTpl">
    <input type="checkbox" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{
           d.status== 1 ? 'checked' : '' }}>
</script>
<!--应用类型模板-->
<script type="text/html" id="typeTpl">
    {{#  if(d.type == '1'){ }}
    <span class="layui-col-md8">1</span>
    {{#  } else if(d.type == '2'){ }}
    <span class="layui-col-md8">2</span>
    {{#  } else if(d.type == '3'){ }}
    <span class="layui-col-md8">3</span>
    {{#  } else { }}
    <span class="layui-col-md8">类型错误</span>
    {{#  } }}
</script>

<style>
    /*列表展示图片时需要添加*/
    .layui-table-cell {
        height: auto;
    }

    #add_edit_form {
        margin-top: 20px;
        margin-right: 20px;
    }

    #image {
        height: 200px;
        width: 200px;
        margin-top: 10px;
        border: 1px solid #e5e5e5;
    }

    input[id=addImgPut] {
        border: 0px solid red;
        position: absolute;
        left: 0px;
        top: 0px;
        opacity: 0;
        height: 36px;
        width: 200px;
    }

    input[id=addImgPut] :hover {
        cursor: pointer;
    }

    #image1 {
        border: 1px solid #e5e5e5;
    }

    #image1, #image1 img {
        height: 140px;
        width: 140px;
    }
</style>
